export const DateUtil = class DateUtil {
    /**
     * 获取当前日期时间
     * @returns {string}
     */
    static now(){
        const time=new Date();
        let year=time.getFullYear();
        let month=(time.getMonth()+1)<10?'0'+(time.getMonth()+1):time.getMonth()+1;
        let day=time.getDate()<10?'0'+time.getDate():time.getDate();
        let hours=time.getHours()<10?"0"+time.getHours():time.getHours();
        let minutes=time.getMinutes()<10?"0"+time.getMinutes():time.getMinutes();
        let seconds=time.getSeconds()<10?"0"+time.getSeconds():time.getSeconds();
        return year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
    }

    /**
     * 获取当前日期
     * @returns {string}
     */
    static today(){
        const time=new Date();
        let year=time.getFullYear();
        let month=(time.getMonth()+1)<10?'0'+(time.getMonth()+1):time.getMonth()+1;
        let day=time.getDate()<10?'0'+time.getDate():time.getDate();
        return year+"-"+month+"-"+day
    }
}
